import Mock from "mockjs";
import { Local } from "../utils";
class uploadConfEntity {
  fieldsSession = Local('uploadConfEntity-fields', Mock.mock([
    {
      oss_name: '阿里云上传',
      oss_type: 'alioss',
      desc: '@cword(20)',
      "is_use|0-1": 0,
      oss_url: '/systemConfiguration/cloudUploadSet/aliYunPage',
    },
  ]))
  get fields() {
    return this.fieldsSession.get();
  }
  set fields(obj: any) {
    this.fieldsSession.set(obj)
  }
  findAll() {
    return this.fields;
  }
  updateOne(field: string, val: any) {
    let obj = this.findAll();
    obj[field] = val;
    this.fields = obj;
    return this.fields[field];
  }
}

export default uploadConfEntity;